package com.chj.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.chj.entity.User;
import com.chj.util.ResultSetUtil;
import com.etc.jdbc.mapper.RowMapper;

public class UserMapper implements RowMapper<User>{

	@Override
	public User mapRow(ResultSet rs) throws SQLException {

		User user = new User();

		user.setUserPk(ResultSetUtil.getString(rs, "user_pk"));             //user_pk	     varchar 
		user.setUserId(ResultSetUtil.getString(rs, "user_id"));             //user_id	     varchar 
		user.setUserName(ResultSetUtil.getString(rs, "user_name"));         //user_name	 varchar 
		user.setUserPassword(ResultSetUtil.getString(rs, "user_password")); //user_password varchar 
		user.setUserType(ResultSetUtil.getInt(rs, "user_type"));		     //user_type	 int     
		user.setUserStatus(ResultSetUtil.getInt(rs, "user_status"));        //user_status	 int     
		user.setUserPhone(ResultSetUtil.getString(rs, "user_phone"));       //user_phone	 varchar 
		user.setUserEmail(ResultSetUtil.getString(rs, "user_email"));       //user_email	 varchar 
		user.setCreateDate(ResultSetUtil.getDate(rs, "create_date"));       //create_date	 datetime
		user.setModifyDate(ResultSetUtil.getDate(rs, "modify_date"));       //modify_date	 datetime
		user.setDeleteDate(ResultSetUtil.getDate(rs, "delete_date"));       //delete_date	 datetime
		user.setStatus(ResultSetUtil.getInt(rs, "status"));                 //status	     int     

		return user;
	}

}
